https://glot.io/snippets/gj4gryrhbj/raw/main.lua